import request from '@/utils/request'

// 查询商品评论信息列表
export function listComments(query) {
console.log(query)
  return request({
    url: '/buyers/comments/list',
    method: 'get',
    params: query
  })
}

// 查询商品评论信息详细
export function getComments(commentId) {
  return request({
    url: '/buyers/comments/' + commentId,
    method: 'get'
  })
}

// 新增商品评论信息
export function addComments(data) {
  return request({
    url: '/buyers/comments',
    method: 'post',
    data: data
  })
}

// 修改商品评论信息
export function updateComments(data) {
  return request({
    url: '/buyers/comments',
    method: 'put',
    data: data
  })
}

// 删除商品评论信息
export function delComments(commentId) {
  return request({
    url: '/buyers/comments/' + commentId,
    method: 'delete'
  })
}

export function selectByGoodAndUser(data) {
  console.log(data)
  return request({
    url: '/buyers/comments/selectByGoodAndUser',
    method: 'get',
    params: data
  })
}
export function selectByGood(data) {
   return request({
     url: '/buyers/comments/selectByGood',
     method: 'get',
     params: data
   })
 }
